package com.hackerrank.contests.nov13.challenges.utopiantree;

import java.util.Scanner;

public class Solution {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int T = in.nextInt();
		for(int t = 0; t < T; t++) {
			int N = in.nextInt(), S = N / 2, P = N - S;
			long H = (long)Math.pow(2, N - N / 2 + 1) - 1;
			if(S != P)
				System.out.println(H - 1);
			else
				System.out.println(H);
		}
	}
}
